using System;

namespace WIT.DAQ.Core.Models;

/// <summary>
/// 任务方法参数
/// </summary>
internal class TaskParam
{
	/// <summary>
	/// Id
	/// </summary>
	internal Guid Id { get; set; }

	/// <summary>
	/// 站点Id
	/// </summary>
	internal Guid StationId { get; set; }

	/// <summary>
	/// 采集项Id
	/// </summary>
	internal Guid DAQItemId { get; set; }

	/// <summary>
	/// 采集项
	/// </summary>
	internal DAQItem DAQItem { get; set; }

	/// <summary>
	/// 采集项名称
	/// </summary>
	public string DAQItemName => DAQItem.Name;

	/// <summary>
	/// 是否为常量
	/// </summary>
	internal bool IsConst { get; set; }

	/// <summary>
	/// 常量的值
	/// </summary>
	internal string Const { get; set; }

	/// <summary>
	/// 是否为常量的显示文本
	/// </summary>
	public string IsConstShowText => IsConst ? "是" : "否";

	/// <summary>
	/// 是否需要单独读取
	/// </summary>
	internal bool SingleRead { get; set; }

	/// <summary>
	/// 读取失败时使用的默认值
	/// </summary>
	internal string DefaultValue { get; set; }

	/// <summary>
	/// 是否为需要单独读取的显示文本
	/// </summary>
	public string SingleReadShowText => SingleRead ? "是" : "否";
}
